#include "GUITreeNode.h"

GUITreeNode::GUITreeNode()
{
}

void GUITreeNode::Title( std::string& title )
{
	m_title = title;
}
std::string GUITreeNode::Title() const
{
	return m_title;
}

void GUITreeNode::AddChildNode( Pointer<GUITreeNode>& child )
{
	m_nodes.push_back(child);
}
Pointer<GUITreeNode> GUITreeNode::FindChildNode( GUITreeNode* child )	// Takes a whil
{
	return 0;
}
void GUITreeNode::RemoveChild( unsigned int index )
{
	m_nodes.erase(m_nodes.begin() + index);
}
void GUITreeNode::RemoveChild( GUITreeNode* child )
{
	for (unsigned int i = 0; i < m_nodes.size(); ++i)
	{
		if (m_nodes[i].getPointer() == child)
		{
			m_nodes.erase(m_nodes.begin() + i);
			return;
		}
	}
}
GUITreeNode::Vector_t& GUITreeNode::Children()
{
	return m_nodes;
}

void GUITreeNode::Open( bool open )
{
	m_isOpen = open;
}
bool GUITreeNode::Open() const
{
	return m_isOpen;
}